home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / JAVA / IO / PipedOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  913 b   |  49 lines

  1. package java.io;
  2.  
  3. public class PipedOutputStream extends OutputStream {
  4.    private PipedInputStream sink;
  5.  
  6.    public PipedOutputStream(PipedInputStream var1) throws IOException {
  7.       this.connect(var1);
  8.    }
  9.  
  10.    public PipedOutputStream() {
  11.    }
  12.  
  13.    public void connect(PipedInputStream var1) throws IOException {
  14.       this.sink = var1;
  15.       var1.closed = false;
  16.       var1.in = -1;
  17.       var1.out = 0;
  18.    }
  19.  
  20.    public void write(int var1) throws IOException {
  21.       this.sink.receive(var1);
  22.    }
  23.  
  24.    public void write(byte[] var1, int var2, int var3) throws IOException {
  25.       this.sink.receive(var1, var2, var3);
  26.    }
  27.  
  28.    public synchronized void flush() throws IOException {
  29.       if (this.sink != null) {
  30.          PipedInputStream var1 = this.sink;
  31.          synchronized(var1){}
  32.  
  33.          try {
  34.             this.sink.notifyAll();
  35.          } catch (Throwable var3) {
  36.             throw var3;
  37.          }
  38.  
  39.       }
  40.    }
  41.  
  42.    public void close() throws IOException {
  43.       if (this.sink != null) {
  44.          this.sink.receivedLast();
  45.       }
  46.  
  47.    }
  48. }
  49.